home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1984-04-24 | 1.7 KB | 45 lines |
- 10 CLS:KEY OFF
- 20 COLOR 15,0:PRINT TAB(32);"BULLSEYE":COLOR 7,0
- 30 PRINT TAB(15);"Dart game for the IBM Personal Computer"
- 40 PRINT :PRINT :PRINT
- 50 PRINT TAB(10);"In this game, up to 20 players throw at the target"
- 60 PRINT TAB(10);"with 10,20,30 and 40 point zones. The objective is"
- 70 PRINT TAB(10);"to get 200 points.":PRINT
- 80 COLOR 1,0:PRINT "Throw";TAB(20);"Description";TAB(45);"Probable score ":COLOR 7,0
- 90 PRINT " 1";TAB(20);"Fast overarm";TAB(45);"Bullseye or complete miss"
- 100 PRINT " 2";TAB(20);"Controlled overarm";TAB(45);"10, 20 or 30 points"
- 110 PRINT " 3";TAB(20);"Underarm";TAB(45);"Anything":PRINT
- 120 DIM A$(20),S(20),W(10): M=0: R=0: FOR I= 1 TO 20: S(I)=0: NEXT I
- 130 INPUT "How many players";N:PRINT
- 140 IF N=0 THEN PRINT "Nobody to throw the dart's ... End of game!":KEY ON:END
- 150 IF N>20 THEN PRINT "Up to 20 players":GOTO 130
- 160 FOR I=1 TO N
- 170 PRINT "Name of player no. ";I;: INPUT A$(I)
- 180 NEXT I
- 190 R=R+1:PRINT :PRINT "ROUND";R
- 200 FOR I= 1 TO N
- 210 PRINT :PRINT A$(I)"'s throw";: INPUT T
- 220 IF T<0 OR T>3 THEN PRINT "INPUT 1, 2, or 3 !": GOTO 210
- 230 GOSUB 410: ON T GOTO 240,250,240
- 240 P1=0.65:P2=0.55:P3=0.5:P4=0.5:GOTO 270
- 250 P1=0.99:P2=0.77:P3=0.43:P4=0.01:GOTO 270
- 260 P1=0.95:P2=0.75:P3=0.45:P4=0.05
- 270 U=RND(1)
- 280 IF U>=P1 THEN GOSUB 420:PRINT "BULLSEYE !! 40 Points":B=40:GOTO 330
- 290 IF U>=P2 THEN GOSUB 430:PRINT "30-Point zone":B=30:GOTO 330
- 300 IF U>=P3 THEN GOSUB 430:PRINT "20-Point zone":B=20:GOTO 330
- 310 IF U>=P4 THEN GOSUB 430:PRINT "10-Point zone":B=10:GOTO 330
- 320 GOSUB 440: PRINT "Missed the target! Too bad.":B=0
- 330 S(I)=S(I)+B:PRINT "Total score for ";A$(I);" is";S(I):NEXT I
- 340 FOR I=1 TO N
- 350 IF S(I)>=200 THEN M=M+1:W(M)=I
- 360 NEXT I
- 370 IF M=0 THEN 190
- 380 PRINT :PRINT "We have a winner !!":PRINT
- 390 FOR I= 1 TO M:PRINT A$(W(I));" scored";S(W(I));"points.":NEXT I
- 400 PRINT :PRINT "THANKS for the game.":KEY ON:END
- 410 FOR Z=800 TO 50 STEP-20: SOUND Z,0.5:NEXT:RETURN
- 420 PLAY "l16cdefgab":RETURN
- 430 FOR Z=1 TO 3: SOUND 400,3:SOUND 200,3:NEXT:RETURN
- 440 SOUND 125,14:SOUND 55,9:RETURN
-